<template>
  <div>
    <van-nav-bar title="" left-text="返回"  left-arrow  @click-left="onClickLeft"
                 @click-right="onClickRight" />
    <div id="header" style="width: 100%;height:auto ; border: 1px solid silver;border-radius: 20px;">
      <div id="title">
        <h3>{{this.studyInfo.studyTitle}}</h3>
      </div>
      <div id="body" style=" padding: 20px;">
      <span style="line-height: 30px;">
        {{this.studyInfo.studyContex}}
      </span>
      </div>
      <div style="float: right">
        <span>来源:{{this.studyInfo.user.userTruename}}</span>
        <span>发布时间:{{this.studyInfo.studyDate}}</span>
      </div>
    </div>

  </div>
</template>

<script>
import axios from 'axios'
export default {
  data() {
    return {
      studyId: '',
      studyClassify: '',
      studyInfo: {}
    }
  },
  methods: {
    //============================通过id从redis中获取数据模块内容==============
    findstudyById() {
      axios.post("http://localhost:7000/Dj/selectOne/" +this.studyClassify+"/"+this.studyId).then(res => {

        this.studyInfo = res.data.data;

      });
    },

    //============================返回上一级=================================
    onClickLeft() {
      this.$router.go(-1)
    },

  },
  mounted() {
    this.studyId = this.$route.params.id;
    this.studyClassify = this.$route.params.stu;

    this.findstudyById();
  },
  name: "studygroup"
}
</script>

<style scoped>

</style>
